<div id='panel'>
<table width="100%" align="center" border="0" cellpadding="0" cellspacing="0">
 <tr>
  <td>	
  <?php
	//delete single product		 
	if(!empty($_POST['hidDelPro'])) {
	
		$proId=$_POST['hidDelPro'];
		$sqlDelPro="Delete from tbl_product where product_id=$proId";
		$rstDelPro=mysql_query($sqlDelPro);
		if($rstDelPro) { 
			$imgPaths=getImagePath($proId);
			if($imgPaths[0]!="") { unlink($imgPaths[0]); }
			if($imgPaths[1]!="") { unlink($imgPaths[1]); }
			if($imgPaths[2]!="") { unlink($imgPaths[2]); }
			echo "<div id='suc-msg'> Your product deleted. </div>"; 
		}	
		else {
			echo "<div id='err-msg'> Your product could not be deleted. </div>";
		}
	}			
	   
 ?>
 <form name="frmProlist" id="frmProlist" method="post" action="">
	<input type="hidden" name="hidDelPro" id="hidDelPro">
 <?php	
   $userId = $_SESSION['user_id_sess'];	   
   $sqlSelPro="SELECT * FROM tbl_product where posted_by='$userId' ORDER BY product_id DESC LIMIT 0, 10";
   $rstSelPro=mysql_query($sqlSelPro);				  
   $num=mysql_num_rows($rstSelPro);
   echo "<table width='100%' border='0' align='center' cellspacing='0'>";
   echo "<tr class='head-tr'>
		  <td width='47%' colspan='3'><strong>Your items being sold</strong></td>		  
		  <td width='11%' align='center'> <strong>Online/Local</strong></td>
		  <td width='11%' align='center'> <strong>Quantity</strong> </td>
		  <td width='15%' align='center'><strong>Price+Ship</strong> </td>
		  <td width='3%'>&nbsp; </td>
		  <td width='10%'>&nbsp; </td>
		</tr>";				 
   if($num==0)
	{
	  echo "<tr>
			   <td colspan='7'> <p style='padding:5px;'>No items found on your list...</p> </div> </td>
			</tr></table>";   
	  //echo "<br>";
	  //echo "<div style='border-top:1px solid #CCCCCC;'> </div><br>";
	}
   else {		 
		 $r=1;
		 while($rowSelPro=mysql_fetch_array($rstSelPro))
		 {						   
		   $productId=$rowSelPro['product_id'];
		   $productName=wordFormater($rowSelPro['product_name'],30);
		   $productTitle = $rowSelPro['product_name'];					   
		   $productPrice=$rowSelPro['product_price'];
		   $productThumb=$rowSelPro['product_thumbnail'];
		   $productImage=$rowSelPro['product_image'];
		   $postedDate=$rowSelPro['posted_date'];
		   $quantity=$rowSelPro['quantity'];
		   $bargainDate = $rowSelPro['bargain_duration'];
		   $sellingType = $rowSelPro['selling_type'];
		   $condition = $rowSelPro['pro_condition'];
		   $shipping = $rowSelPro['shipping'];
		   $timeLeft = getRemainingTime($bargainDate);
		   
		   if($shipping!="Free") {
			$shipping = number_format($shipping,2);
		   } else { $shipping="0.00"; }
		   $proTotalPrice=$productPrice."+".number_format($shipping,2);
		  
							   
		   echo "<tr>
				 <td height='28' width='3%' align='center'> $r </td>							         
				 <td> <a href='index.php?products=$productId' title='$productTitle'> $productName </a> </td>
				 <td align='center' width='6%'> $condition &nbsp;</td>
				 <td align='center'> $sellingType </td>
				 <td align='center'> $quantity </td>
				 <td align='center'> $proTotalPrice </td>
				 <td align='center'><a href='index.php?editlist=$productId'>Edit</a></td>
				 <td align='center'><a href='javascript:void(0);' onClick='funDelProduct($productId)'>Delete</a></td>
			   </tr>";	
			echo "<tr>
					 <td colspan='8'> <div style='border-top:1px solid #CCCCCC;'> </div> </td>
				  </tr>";   			  
			$r++;
		 }
		echo "<tr>
				 <td>&nbsp;</td>
				 <td colspan='7'> <a href='index.php?mylist'>more...</a><br><br> </td>
			  </tr>";		
		echo "</table>";				    	
		
	} 				
?>
</form>
  </td>
 </tr>
</table>
</div><br>